package cn.zymall.order.service;

import cn.zymall.common.model.Order;
import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
import com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderResult;
import com.github.binarywang.wxpay.exception.WxPayException;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * @program: mall
 * @description: 微信支付业务层
 * @author: YueNiao
 * @email: 1486617253@qq.com
 * @create: 2020-08-21 20:28
 **/

public interface MyWxPayService {
	/**
	 * 。
	 * @param response
	 * @param order
	 * @return
	 */
	public Map<String, String> wxToPay(HttpServletResponse response,  Order order);

	/**
	 * 异步回调
	 * @param xmlData
	 * @throws WxPayException
	 */
	void wxNotify(String xmlData) throws WxPayException;

	/**
	 * 发送微信支付请求
	 * @param request
	 * @param order
	 * @return
	 */
	public WxPayUnifiedOrderResult unifiedOrder(WxPayUnifiedOrderRequest request, Order order)throws WxPayException;

	/**
	 * 订单状态查询
	 * @param orderId
	 * @return
	 * @throws WxPayException
	 */
	public boolean searchWxOrder(String orderId) throws WxPayException;
}
